package com.icangya.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.icangya.domain.*;

import java.sql.Timestamp;
import java.util.List;

public interface IMissionService {  //任务   大转盘

   /**
    * 获取所有的任务
    * @return
    */
     List<FbBackMission>  getFbBackMission();


 FbBackMission getMissionByMissionId(long missionId);

   /**
    * 获取所有的奖励信息
    * @return
    */
   List<FbMissionAward> getFbMissionAward();

    /**
     * 获取可领取的奖励
     * @return
     */
    List<FbMissionAward> getMissionAwardStatus();
    /**
     * 获取单条奖励信息
     * @return
     */
    FbMissionAward getMissionAward(long awardId);

    /**
     * 修改奖励领取的状态
     * @param fbMissionAward
     * @return
     */
    Boolean updateMissionAward(FbMissionAward fbMissionAward);

    /**
     * 获取当天的任务
     * @return
     */
    JSONArray getMissionRecordNow( String openId);

    FbMissionRecord getMissionRecord(Timestamp now, long missionId);

    /**
     * 添加任务记录
     * @param fbMissionRecord
     * @return
     */
    FbMissionRecord saveFbMissionRecord(FbMissionRecord fbMissionRecord);
    /**
     * 添加用户领取任务的记录
     * @param userMission
     * @return
     */
    int saveUserMission(FbUserMission userMission);

    /**
     * 查询用户当天领取之后未完成的任务
     * @param missionId
     * @return
     */
    Object[] getUserMissionIdNow(long missionId);

    FbUserMission getFbUserMission(long id);

    Boolean  updateUserMission(FbUserMission userMission);

    /**
     * 查询用户未领取的转盘记录
     * @param uid
     * @return
     */
    List<FbTurntableRecord> getFbTurntableRecord(long uid);

    FbTurntableRecord saveFbTurntableRecord(FbTurntableRecord turntableRecord);

    boolean updateTurntableRecord(FbTurntableRecord turntableRecord);

    long getTurntableRecordCount(String openId);

    /**
     * 查询系统当天赠送的记录
     * @param missionId    0
     * @return
     */
    FbTurntableRecord getTurntableRecordBySystem(long missionId,String openId);
  //添加用户奖励记录
    FbUserAwardRecord saveUserAwardRecord(FbUserAwardRecord userAwardRecord);

  //修改用户奖励记录
    boolean updateUserAwardRecord(FbUserAwardRecord userAwardRecord);

    //根据id查询用户奖励记录
   FbUserAwardRecord  getFbUserAwardRecord(long userAwardId);

 /**
  * 根据奖励id，查询用户奖励
  * @param awardId
  * @return
  */
 FbUserAwardRecord getUserAwardByAwardId(long  awardId,String openId);

 //获取用户所有任务奖励记录
 List<FbUserAwardRecord> getUserAwardRecord(String openId);

 //根据奖励id查询奖励商品的详情
 FbAwardDetails getAwardDetailsByAwardId(long awardId);
//添加地址
 FbAddress saveFbAddress(FbAddress address);

 //查询用户所填写的地址
 List<FbAddress> getFbAddressAll(String openId);

 FbAddress getAddressByOpenId(String openId,long id);

 Boolean updateFbAddress(FbAddress address);

 FbAddress getAddressDefault(String openId);

 FbOrder saveFbOrder(FbOrder order);


 //查询用户所有订单
 List<FbOrder> getUserFbOrder(String openId);

 //查询所有订单
 List<FbOrder> getFbOrderAll();

 //根据状态查询所有订单
 List<FbOrder> getFbOrderStatusAll(int status,int paymentStatus);


 FbOrder getOrderByOutTrantId(String orderNum);

 boolean updateOrder(FbOrder fbOrder);

}
